#pragma	once			


#include	"../Headers/types.h"			
#include	"../Headers/config.h"		
#include	"../Headers/log.h"		
#include  "../Headers/authr.h"
#include  "../Headers/nsr.h"
#include  "fs.rpc.h"
#include  "fs.file.h"
#include  <string>
#include  <iostream>

namespace TOB {
	
	/*
	 * =====================================================================================
	 *        Class:  FS_Server
	 *  Description:  FileSharing Server
	 * =====================================================================================
	 */
	class FS_Server 
	{
		public:
			/* ====================  LIFECYCLE     ======================================= */
			FS_Server ();   
			~FS_Server();
			/* *
			 * push file name in a file
			 * @param fileName File name
			 * @return file id
			 * */
			uint32 push(std::string fileName);
			/* *
			 * pop file name 
			 * @param file id
			 * @return file name
			 * */
			std::string pop(uint32 fileId);
			/* *
			 * int to string
			 * @param i integer number
			 * @return string
			 * */
			std::string toString(uint32 i);
						/* *
			 * auth
			 * @param nsip
			 * @param username
			 * @param password
			 * @param res
			 * @return bool
			 * */
			uint32 auth(Nameserver::IP nsip, std::string username, std::string password, bool* res);
			File f;
			std::string path;
		private:
			/* *
			 * refresh file id value
			 * @return void
			 * */
			void refresh();
			uint32 fileId;

			/* ====================  DATA MEMBERS  ======================================= */

	}; /* -----  end of class FS_Server  ----- */

}
